# -*- python -*-
# ex: set syntax=python:

# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

slaves = []

########## Linux

linux_cq_builders = [
  # Keep important bots in the beginning in order to assign several preferred
  # builders.
  'v8_linux_chromium_gn_rel',
  'v8_linux64_sanitizer_coverage_rel',

  # Other bots.
  'v8_linux_rel_ng',
  'v8_linux_verify_csa_rel_ng',
  'v8_linux_nodcheck_rel_ng',
  'v8_linux_dbg_ng',
  'v8_linux_noi18n_rel_ng',
  'v8_linux_gcc_compile_rel',
  'v8_linux64_gcc_compile_dbg',
  'v8_linux64_rel_ng',
  'v8_linux64_verify_csa_rel_ng',
  'v8_linux64_avx2_rel_ng',
  'v8_linux64_asan_rel_ng',
  'v8_linux64_gyp_rel_ng',
  'v8_linux_arm_rel_ng',
  'v8_linux_arm64_rel_ng',
  'v8_linux_mipsel_compile_rel',
  'v8_linux_mips64el_compile_rel',
  'v8_android_arm_compile_rel',
]

linux_optional_builders = [
  'v8_node_linux64_rel',
  'v8_linux_avx2_dbg',
  'v8_linux_gc_stress_dbg',
  'v8_linux_nosnap_rel',
  'v8_linux_nosnap_dbg',
  'v8_linux_gcc_rel',
  'v8_linux64_avx2_dbg',
  'v8_linux64_msan_rel',
  'v8_linux64_tsan_rel',
  'v8_linux64_tsan_concurrent_marking_rel_ng',
  'v8_linux_arm_dbg',
  'v8_linux_arm_armv8a_rel',
  'v8_linux_arm_armv8a_dbg',
  'v8_linux_arm64_dbg',
  'v8_linux_arm64_gc_stress_dbg',
  'v8_android_chromium_gn_dbg',
]

# List important bots several times to assign as preferred builders more often.
linux_preferred_builders = [
  'v8_linux_chromium_gn_rel',
  'v8_linux64_sanitizer_coverage_rel',
] + linux_cq_builders

linux_slaves = [
  'slave%d-c4' % i for i in range(403, 417) +
                            range(584, 590) +
                            range(868, 872) +
                            range(1204, 1210) +
                            range(1399, 1403) +
                            range(1406, 1409) +
                            [548, 736, 737]
]

slaves.extend([
  {
    'master': 'V8TryServer',
    'builder': linux_cq_builders + linux_optional_builders,
    'preferred_builder':
        linux_preferred_builders[i % len(linux_preferred_builders)],
    'hostname': slave,
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  } for i, slave in enumerate(linux_slaves)
])

# Presubmit pool.
slaves.extend([
  {
    'master': 'V8TryServer',
    'builder': 'v8_presubmit',
    'hostname': 'slave%d-c4' % i,
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  } for i in [549]
])

########## Windows

win_cq_builders = [
  'v8_win_rel_ng',
  'v8_win_compile_dbg',
  'v8_win_nosnap_shared_rel_ng',
  'v8_win64_rel_ng',
]

win_optional_builders = [
  'v8_win_dbg',
  'v8_win64_dbg',
]

win_slaves = [
  'vm%d-m4' % i for i in range(204, 207) + [259, 261, 262, 805, 1067]
]

slaves.extend([
  {
    'master': 'V8TryServer',
    'builder': win_cq_builders + win_optional_builders,
    'preferred_builder': win_cq_builders[i % len(win_cq_builders)],
    'hostname': slave,
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  } for i, slave in enumerate(win_slaves)
])

########## Mac

slaves.extend([
  {
    'master': 'V8TryServer',
    'builder': [
      'v8_mac_rel_ng',
      'v8_mac_dbg',
      'v8_mac_gc_stress_dbg',
      'v8_mac64_rel',
      'v8_mac64_dbg',
      'v8_mac64_asan_rel',
    ],
    'hostname': name,
    'os': 'mac',
    'version': '10.9',
    'bits': '64',
  } for name in ['vm660-m4', 'vm820-m4', 'vm880-m4']
])

########## Blink

slaves.extend([
  {
    'master': 'V8TryServer',
    'builder': [
      'v8_linux_blink_rel',
    ],
    'hostname': 'build%d-m4' % i,
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  } for i in range(45, 48)
])

########## Triggered slaves

# Subdir slaves.
for i in xrange(400, 403):
  for j in xrange(25):
    slaves.append({
      'master': 'V8TryServer',
      'builder': [
        'v8_linux_rel_ng_triggered',
        'v8_linux_verify_csa_rel_ng_triggered',
        'v8_linux_nodcheck_rel_ng_triggered',
        'v8_linux_dbg_ng_triggered',
        'v8_linux_noi18n_rel_ng_triggered',
        'v8_linux64_rel_ng_triggered',
        'v8_linux64_verify_csa_rel_ng_triggered',
        'v8_linux64_avx2_rel_ng_triggered',
        'v8_linux64_asan_rel_ng_triggered',
        'v8_linux64_tsan_concurrent_marking_rel_ng_triggered',
        'v8_linux64_gyp_rel_ng_triggered',
        'v8_linux_arm_rel_ng_triggered',
        'v8_linux_arm64_rel_ng_triggered',
        'v8_win_rel_ng_triggered',
        'v8_win_nosnap_shared_rel_ng_triggered',
        'v8_win64_rel_ng_triggered',
        'v8_mac_rel_ng_triggered',
      ],
      'hostname': 'slave%d-c4' % i,
      'os': 'linux',
      'version': 'trusty',
      'bits': '64',
      'subdir': str(j),
    })
